/*
 * AuthService.java
 *
 * Created on July 1, 2007, 1:22 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.atomojo.app.auth;

import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import org.atomojo.app.db.DB;

/**
 *
 * @author alex
 */
public interface AuthService
{
   public final static String ADMIN_USER = "admin";
   public final static String ADMIN_GROUP = "admin";
   
   void init(Properties props)
      throws AuthException;
   
   boolean createGroup(AuthCredentials cred,String name)
      throws AuthException;
   boolean deleteGroup(AuthCredentials cred,String name)
      throws AuthException;
   
   boolean addUserToGroup(AuthCredentials cred,String alias,String name)
      throws AuthException;
   boolean removeUserFromGroup(AuthCredentials cred,String alias,String name)
      throws AuthException;
   
   User createUser(AuthCredentials cred,String alias,String name,String email,String password) 
      throws AuthException;
   boolean deleteUser(AuthCredentials cred,String alias)
      throws AuthException;
   
   User getUser(AuthCredentials cred,String alias)
      throws AuthException;
   Iterator<User> getUsers(AuthCredentials cred)
      throws AuthException;
   
   
   boolean updateUser(AuthCredentials cred,String alias,String name,String email)
      throws AuthException;
   
   boolean setPassword(AuthCredentials cred,String alias,String email)
      throws AuthException;
   
   User authenticate(String alias,String password)
      throws AuthException;
   
   User verifySession(String session)
      throws AuthException;
}
